package com.west_traveler.viewpager_adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.LinkedList;

/**
 * created by Wang_JunJie at 2016/12/9
 */
public class ProvinceRadioFrgAdapter extends FragmentStatePagerAdapter{
    LinkedList<String> provinceNames;
    LinkedList<Fragment> frgs;
    public ProvinceRadioFrgAdapter(FragmentManager fm, LinkedList<String> provinceNames,LinkedList<Fragment> frgs) {
        super(fm);
        this.provinceNames=provinceNames;
        this.frgs=frgs;
    }

    @Override
    public Fragment getItem(int position) {
        return frgs.get(position);
    }

    @Override
    public int getCount() {
        return frgs.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return provinceNames.get(position);
    }
}
